﻿using System;
using Microsoft.AspNetCore.Mvc;

namespace PMP.Core.Extensions;

// 自定义简化特性，替代冗长的 [ModelBinder(typeof(...))]
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
public class FromJsonAttribute : ModelBinderAttribute
{
    // 构造函数中指定绑定器类型
    public FromJsonAttribute() : base(typeof(JsonObjectToSimpleTypeBinder))
    {
    }
}